package com.zsummer.zero.spring;

import java.util.Arrays;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StartApp {

	private static ApplicationContext context;
	
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
		StartApp.setContext(context);
		
		String[] names = context.getBeanDefinitionNames();
		System.out.println(Arrays.toString(names));
		System.out.println(context.getBean("trigger").getClass());
	}
	
	public static void setContext(ApplicationContext context) {
		StartApp.context = context;
	}
	
	public static ApplicationContext getContext() {
		return context;
	}
}
